package com.qf.controller;

import com.qf.entity.OrderVO;
import com.qf.service.OrderService;
import com.qf.util.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Qiao
 * @date 2025/8/11
 * @desc
 */
@RestController
@Api(tags = "一对一查询接口演示")
public class OrderController {
    @Autowired
    private OrderService orderService;

    @GetMapping("/order/select/{oid}")
    @ApiOperation(value = "根据id查用户信息")
    private R orderSelect(@PathVariable int oid){
        OrderVO vo = orderService.OrderSelect(oid);

        if (vo == null){
            R.fail(5000,"查无此人");
        }

        return R.success(vo);
    }
}
